// 定义一个学生类型
type Student = {
  name: string;
  gender: string;
  score: number;
  height: number;
  study: () => void;
  code: (code: string) => string;
};

// 定义一个学生对象
let student: Student = {
  name: 'Jack',
  gender: '男',
  score: 100,
  height: 180,
  study: () => {
    console.log('good good study');
  },
  code: (code: string) => {
    return code;
  },
};

// 使用对象
console.log(student.name);
console.log(student.code('html'));

// 定义一个学生2
let student2: Student = {
  name: 'Rose',
  gender: '女',
  score: 100,
  height: 180,
  study: () => {
    console.log('good good study');
  },
  code: (code: string) => {
    return code;
  },
};

console.log(student2.name);
console.log(student2.code('css'));
